import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mainclass {

    public static void doHomework(Learnable learnable){
        learnable.read();
    }

    public static void main(String[] args) {

        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

        Learnable learnable = (Learnable) ctx.getBean("student");
        learnable.read();

        learnable = (Learnable) ctx.getBean("teacher");
        learnable.read();
    }
}
